From a980249c45caa086a5e08fe8a827a865c5ea9491 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Thu, 3 Sep 2009 09:50:46 +0100 Subject: [PATCH] x86 vpt: Small performance fixes. 1. once one-shot timer is fired, IRQ is raised repeatedly forever. 2. Test pending_intr_nr before pt_irq_masked(), as it is cheaper. Signed-off-by: Kouya Shimura --- xen/arch/x86/hvm/vpt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/hvm/vpt.c b/xen/arch/x86/hvm/vpt.c index 0cb180ceba..7721873f2c 100644 --- a/xen/arch/x86/hvm/vpt.c +++ b/xen/arch/x86/hvm/vpt.c @@ -229,7 +229,7 @@ void pt_update_irq(struct vcpu *v) list_for_each_entry ( pt, head, list ) { - if ( !pt_irq_masked(pt) && pt->pending_intr_nr && + if ( pt->pending_intr_nr && !pt_irq_masked(pt) && ((pt->last_plt_gtime + pt->period) < max_lag) ) { max_lag = pt->last_plt_gtime + pt->period; @@ -298,6 +298,7 @@ void pt_intr_post(struct vcpu *v, struct hvm_intack intack) if ( pt->on_list ) list_del(&pt->list); pt->on_list = 0; + pt->pending_intr_nr = 0; } else { -- 2.30.2